<?php
    class LoginView{
    	
		//postvariables
		private static $name = "name";
		private static $password = "password";
		private static $logIn = "logIn";
		private static $logOut = "logOut";
    	
		// Function for loginform
		public function DoLoginBox (){
				
			return"<p class='message'></p>
				   <form method='post' class='loginForm'> 
				   	Name: <input type='text' name='name' /><br />
					Password: <input type='text' name='password' />
					<input type='submit' value='Log in' name='logIn'></input>
					<input type='checkbox' name='remember' value='remember' /> Remember me<br />
			       </form>";
		}
		
		public function DoLogoutBox(){
				
			return"<form method='post' class='loginForm'> 
				     <input type='submit' value='Log out' name='logOut'></input>
			       </form>";
		}
		
		public function GetUserName(){
			
			 if(isset( $_POST[self::$name])){
			 	return $_POST[self::$name];	 	
			 }
			 else{
			 	return null;
			 }	
		}
		
		public function GetPassword(){
				
			if(isset( $_POST[self::$password])){
		 	return $_POST[self::$password];	 	
			}
			else{
			 	return null;
			}
		}
		
		
		public function TriedToLogin(){
				
			if(isset($_POST[self::$logIn])){
		 		return true;	 	
			}
			else{
			 	return false;
			}	
		}
		
		public function TriedToLogOut(){
				
			if(isset($_POST[self::$logOut])){
		 		return true;	 	
			}
			else{
			 	return false;
			}	
		}
    } 
?>